#include <stdio.h>

int sum(int m, int n);

int main(void)
{

    printf("1~10的和为：%d\n", sum(1, 10));
    printf("10~20的和为：%d\n", sum(10, 20));
    printf("400~600的和为：%d\n", sum(400, 600));
    return 0;
}


int sum(int m, int n)
{
    int res = 0, i;

    for (i = m; i <= n; i++)
        res +=i;

    return res;
}



